//
//  LYTabBarController.m
//  LYWeiBo
//
//  Created by 老岳 on 13-9-27.
//  Copyright (c) 2013年 LY. All rights reserved.
//

#import "LYTabBarController.h"

@interface LYTabBarController ()

@end

@implementation LYTabBarController

- (void)dealloc
{
    self.homeButton = nil;
    self.meButton = nil;
    self.messageButton = nil;
    self.squreButton = nil;
    self.moreButton = nil;
    
    self.coverButtonView = nil;
    
    [super dealloc];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	self.view.backgroundColor = Main_Color;
    
}

- (void)viewDidAppear:(BOOL)animated
{
    self.homeButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.homeButton.frame = CGRectMake(0, 0, 64, 49);
    self.homeButton.tag = 0;
    [self.homeButton addTarget:self action:@selector(tabBarButtonSelect:) forControlEvents:UIControlEventTouchUpInside];
    [self.tabBar addSubview:self.homeButton];
    
    self.messageButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.messageButton.frame = CGRectMake(64, 0, 64, 49);
    self.messageButton.tag = 1;
    [self.messageButton addTarget:self action:@selector(tabBarButtonSelect:) forControlEvents:UIControlEventTouchUpInside];
    [self.tabBar addSubview:self.messageButton];
    
    self.meButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.meButton.frame = CGRectMake(128, 0, 64, 49);
    self.meButton.tag = 2;
    [self.meButton addTarget:self action:@selector(tabBarButtonSelect:) forControlEvents:UIControlEventTouchUpInside];
    [self.tabBar addSubview:self.meButton];
    
    self.squreButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.squreButton.frame = CGRectMake(192, 0, 64, 49);
    self.squreButton.tag = 3;
    [self.squreButton addTarget:self action:@selector(tabBarButtonSelect:) forControlEvents:UIControlEventTouchUpInside];
    [self.tabBar addSubview:self.squreButton];
    
    self.moreButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.moreButton.frame = CGRectMake(256, 0, 64, 49);
    self.moreButton.tag = 4;
    [self.moreButton addTarget:self action:@selector(tabBarButtonSelect:) forControlEvents:UIControlEventTouchUpInside];
    [self.tabBar addSubview:self.moreButton];
    
    self.coverButtonView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 64, 49)] autorelease];
    self.coverButtonView.backgroundColor = [UIColor blackColor];
}

- (void)tabBarButtonSelect:(UIButton *)button
{
    self.selectedIndex = button.tag;
}

@end


